from selenium import webdriver
from selenium.webdriver.common.by import By
import time
class TestCase:
    def __init__(self):
        self.driver = webdriver.Chrome()

    def clear(self):
        self.driver.get('https://www.baidu.com')
        time.sleep(2)
        kw = self.driver.find_element(By.ID,'kw')
        kw.send_keys('天气预报')

        time.sleep(2)
        kw.clear()

        time.sleep(2)
        kw.send_keys('热干面')

    def get_attribute(self):
        self.driver.get('https://www.baidu.com')
        kw = self.driver.find_element(By.ID,'kw')
        print(kw.get_attribute('autocomplete'))
